import {getUserInfo} from "../../../api/userInfo"
import {findReportByCreatorId} from "../../../api/report"
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onShow(options) {
    let {_id} = await getUserInfo()
    let ret = await findReportByCreatorId(_id)
    if(ret.code == 200){
      this.setData({
        reportList:ret.data.reverse()
      })
    }

    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  toAdd(){
    wx.navigateTo({
      url: '/pages/menu/report/add/index',
    })
  }
})